#include<iostream>
#include<format>
#include<cmath>
using namespace std;
int main()
{
  int a,b,c=1;
  cin>>a>>b;
  while(b--){
      c*=a;
      c%=7;
  }
  switch(c){
    case 1:
    cout<<"Monday";
    break;
    case 2:
    cout<<"Tuesday";
    break;
    case 3:
    cout<<"Wednesday";
    break;
    case 4:
    cout<<"Thursday";
    break;
    case 5:
    cout<<"Friday";
    break;
    case 6:
    cout<<"Saturday";
    break;
    case 0:
    cout<<"Sunday";
    break;
  }
}